approach for maximum product subarray